-
Notifications
You must be signed in to change notification settings - Fork 446
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Will this also fix our macOS builds?
@@ -143,7 +144,7 @@ public WebSocketsTransport(WebSocketOptions options, IDuplexPipe application, De | |||
#if NETCOREAPP2_1 | |||
var receiveResult = await socket.ReceiveAsync(memory, CancellationToken.None); | |||
#else | |||
var isArray = memory.TryGetArray(out var arraySegment); | |||
var isArray = MemoryMarshal.TryGetArray<byte>(memory, out var arraySegment); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the <byte>
not inferrable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The first parameter type is ReadOnlyMemory
, it's either inference or implicit conversion, unfortunately.
I hope so, it contains the fix for the issue OSX we reported. We'll see if it works :) |
@@ -367,7 +367,7 @@ private static Uri CreateConnectUrl(Uri url, string connectionId) | |||
private async Task StartTransport(Uri connectUrl, TransportType transportType) | |||
{ | |||
|
|||
var options = new PipeOptions(readerScheduler: PipeScheduler.ThreadPool); | |||
var options = new PipeOptions(writerScheduler:PipeScheduler.Inline, readerScheduler: PipeScheduler.ThreadPool, useSynchronizationContext: false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: space after :
6524e37
to
58772ef
Compare
{ | ||
_pipeWriter.Write(source.Span); | ||
_length += source.Length; | ||
return Task.CompletedTask; | ||
return new ValueTask(Task.CompletedTask); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return default;
@@ -20,7 +20,7 @@ public static Task SendAsync(this WebSocket webSocket, ReadOnlySequence<byte> bu | |||
#if NETCOREAPP2_1 | |||
if (buffer.IsSingleSegment) | |||
{ | |||
return webSocket.SendAsync(buffer.First, webSocketMessageType, endOfMessage: true, cancellationToken); | |||
return webSocket.SendAsync(buffer.First, webSocketMessageType, endOfMessage: true, cancellationToken).AsTask(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make this method return ValueTask.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Super small set of changes. |
No description provided.